package net.hn.hnms.biz.mine.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * Author: PanSX
 * Date: 2023/5/30 10:52
 */
@Entity
@Table(name = "data_state_config", schema = "public", catalog = "huaneng-smart-mine")
@ApiModel("数据状态配置表")
@Data
public class DataStateConfig {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.common.jpa.utils.CustomIDGenerator")
    private Long id;

    @ApiModelProperty("子系统名称")
    private String sysName;

    @ApiModelProperty("间隔时间配置：秒")
    private Long intervalSecond;

    private String mineCode;

    private String companyCode;

    @Transient
    private String mineName;

    @Transient
    private String companyName;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    @Transient
    private Date maxTime;
    
    @Transient
    private String state;

    @Transient
    @ApiModelProperty("距离现在时长")
    private String interval;
}
